package cn.iocoder.yudao.module.bpm.dal.mysql.tbprocess;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bpm.dal.dataobject.tbprocess.TbProcessDO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.bpm.controller.admin.tbprocess.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 图斑和流程实例关联 Mapper
 *
 * @author admin
 */
@Mapper
public interface TbProcessMapper extends BaseMapperX<TbProcessDO> {

    default PageResult<TbProcessDO> selectPage(TbProcessPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TbProcessDO>()
                .eqIfPresent(TbProcessDO::getTbId, reqVO.getTbId())
                .eqIfPresent(TbProcessDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .betweenIfPresent(TbProcessDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TbProcessDO::getId));
    }

    default List<TbProcessDO> selectList(TbProcessExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<TbProcessDO>()
                .eqIfPresent(TbProcessDO::getTbId, reqVO.getTbId())
                .eqIfPresent(TbProcessDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .betweenIfPresent(TbProcessDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TbProcessDO::getId));
    }

//    Page<TbProcessManageVO> selectPageGroup(IPage<TbProcessManageVO> iPage, @Param(Constants.WRAPPER) Wrapper ew);



}
